Remove a newlineΒΆ

Remove a newline in string.
S = 'Python Exercises\n'

print(S)
print(S.rstrip())

Output:

Python Exercises
Python Exercises